package org.cuit.lmq.domain.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.cuit.lmq.constants.enums.FileTypeEnum;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author Seon
 * @since 2023-03-03
 */
@Data
@Builder
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_file")
public class SystemFile implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;

    /**
     * 文件的外键约束
     */
    private Long foreignId;

    /**
     * 照片路径，位于本地服务器上，例如/local/project/photo/{user_id}/test.jpg,即http请求路径
     */
    private String filePath;

    /**
     * 文件类型
     */
    private FileTypeEnum type;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
